import request from '@/utils/request';

//请求一级属性列表
export const reqCaregroy1List = () => {
    return request({ url: '/admin/product/getCategory1', method: 'get' })
}

//请求二级属性列表
export const reqCaregroy2List = (category1Id) => {
    return request({ url: `/admin/product/getCategory2/${category1Id}`, method: 'get' })
}

//请求三级属性列表
export const reqCaregroy3List = (category2Id) => {
    return request({ url: `/admin/product/getCategory3/${category2Id}`, method: 'get' })
}


//获取商品属性 /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
export const reqAttrList = (category1Id, category2Id, category3Id) => {
    return request({ url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`, method: 'get' })
}

//添加属性与属性值接口
export const reqAddOrUpdateAttr = (data) => request({ url: '/admin/product/saveAttrInfo', method: 'post', data: data });
